<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
         let arr = [22, 3, 54, 12];
        arr.sort(); // 无参，默认按字符串排序
        console.log(arr);

        let arr1 = [22, 13, 4, 32];
        // 数字排序
        arr1.sort(function (a, b) {
            return a - b;
        });
        console.log(arr1);

        // 作业：对象的属性排序。
        // 商品的价格，距离，好评，综合
        let arr2 = [];
    </script>
</body>
</html>